package config;

import org.redisson.api.RLock;

import java.util.concurrent.TimeUnit;

public interface Lock {

    //加锁 会一直循环加锁直到拿到锁
    RLock lock(String lockkey);

    //加锁 指定超时时间
    RLock lock(String lockkey,long timeout);

    //加锁 指定超时时间和单位
    RLock lock(String lockkey,long timeout ,TimeUnit unit);

    //加锁 指定超时时间和单位和十方时间
    RLock lock(String lockkey,long timeout ,TimeUnit unit,long leasetime);

    void unLock(String lockkey);

    void unLocak(RLock rLock);
}
